<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>管理员信息</title>
    <style type="text/css">
        #managerForm{
            margin-top: 30px;
            text-align: center;
        }
        .add{
            margin-left: 550px;
        }
        .information {
            margin-top: 30px;
            border-collapse: collapse;
            border: 1px solid #ccc;
            width: 500px;
        }

        .information td {
            border: 1px solid #ccc;
            text-align: center;
            height: 30px;
        }
    </style>
    <script>
        function edit(id) {
            console.log('edit it is ' + id + ' item');
            location.href = '<%=request.getContextPath()%>/manager/detail?id=' + id;
        }
        function del(id) {
            console.log('del it is ' + id + ' item');
            location.href = '<%=request.getContextPath()%>/manager/delete?id=' + id;
        }
        function toPage(pageIndex) {
            $("#pageIndex").val(pageIndex);
            $("#managerForm").submit();
        }
    </script>
</head>
<body>
<%@include file="../common/headManager.jsp" %>
<form id="managerForm" action="/scvs/manager/list" method="post">
    姓名<input type="text" name="realName" value="${realName}"/>
    <input type="submit" value="搜索"/>
    <input type="hidden" id="pageIndex" value="${pageIndex}" name="pageIndex"/>
</form>
<a href="/scvs/manager/toAdd" class="add">添加</a>
<table align="center" class="information">
    <tr style="font-weight: bold">
        <td style="width: 100px;">Id</td>
        <td style="width: 100px;">登录名</td>
        <td style="width: 100px;">姓名</td>
        <td style="width: 100px;" >密码</td>
        <td style="width: 100px;">操作</td>
    </tr>
    <c:forEach items="${managers}" var="item">
        <tr>
            <td>${item.id}</td>
            <td>${item.userName}</td>
            <td>${item.realName}</td>
            <td>${item.password}</td>
            <td>
                <a href="javascript:edit(${item.id})">编辑</a>
                <a href="javascript:del(${item.id})">删除</a>
            </td>
        </tr>
    </c:forEach>
</table>
<%@include file="../common/footer.jsp" %>
</body>
</html>
